<template>
	<section>
		<!--start 面包屑-->
		<div class="location">
			<el-breadcrumb separator="/">
				<el-breadcrumb-item :to="{path:'/index'}">首页</el-breadcrumb-item>
				<el-breadcrumb-item>设置</el-breadcrumb-item>
				<el-breadcrumb-item>新增</el-breadcrumb-item>
			</el-breadcrumb>
		</div>
		<!--end 面包屑-->
		<!--start content-->
		<div class="wrap" ref="companyWrap">
			<el-form :model="formData" ref="form" label-width="0px" class="formFontSizeMini scroll">
				<el-row :gutter="20">
					<el-col :span="12">
						<el-form-item>
							<el-radio-group v-model="formData.radio_value">
								<el-row>
									<el-radio class="radio" label="1">
										<span class="xtTitle">订单数据初始化</span>
										<p class="systemInitialization1"><span class="systemInitialization2">订单：</span>订货单、出库发货记录、订单商品统计</p>
										<p class="systemInitialization1"><span class="systemInitialization2">资金管理：</span>收款确认</p>
										<p class="systemInitialization1"><span class="systemInitialization2">资金报表：</span>收支明细</p>
										<p class="systemInitialization1"><span class="systemInitialization2">采购管理：</span>采购订单、采购待入库</p>
										<p class="systemInitialization1"><span class="systemInitialization2">库存管理：</span>商品库存、商品入库、商品出库、商品出入库明细、商品收发汇总</p>
										<p class="systemInitialization1"><span class="systemInitialization2">促销管理：</span>订单促销</p>
									</el-radio>
								</el-row>
								<el-row>
									<el-radio class="radio" label="2">
										<span  class="xtTitle">商品、订单数据初始化</span>
										<p class="systemInitialization1"><span class="systemInitialization2">订单：</span>订货单、出库发货记录、订单商品统计</p>
										<p class="systemInitialization1"><span class="systemInitialization2">资金管理：</span>收款确认</p>
										<p class="systemInitialization1"><span class="systemInitialization2">资金报表：</span>收支明细</p>
										<p class="systemInitialization1"><span class="systemInitialization2">商品管理：</span>商品列表、商品类别、计量单位、品牌管理</p>
										<p class="systemInitialization1"><span class="systemInitialization2">促销管理：</span>商品促销、订单促销</p>
										<p class="systemInitialization1"><span class="systemInitialization2">库存管理：</span>商品库存、商品入库、商品出库、商品出入库明细、商品收发汇总、仓库设置</p>
										<p class="systemInitialization1"><span class="systemInitialization2">采购管理：</span>采购订单、采购待入库、供应商</p>
										<p class="systemInitialization1"><span class="systemInitialization2">通知公告：</span>通知公告、广告通知</p>
									</el-radio>
								</el-row>
								<el-row>
									<el-radio class="radio" label="3">
										<span  class="xtTitle">客户、商品、订单数据初始化</span>
										<p class="systemInitialization1"><span class="systemInitialization2">订单：</span>订货单、出库发货记录、订单商品统计</p>
										<p class="systemInitialization1"><span class="systemInitialization2">商品管理：</span>商品列表</p>
										<p class="systemInitialization1"><span class="systemInitialization2">库存管理：</span>商品库存、商品入库、商品出库、商品出入库明细、商品收发汇总、仓库设置</p>
										<p class="systemInitialization1"><span class="systemInitialization2">采购管理：</span>供应商管理、采购订单、采购待入库</p>
										<p class="systemInitialization1"><span class="systemInitialization2">客户：</span>客户列表</p>
										<p class="systemInitialization1"><span class="systemInitialization2">资金管理：</span>收款确认、资金账户、收支明细</p>
										<p class="systemInitialization1"><span class="systemInitialization2">营销：</span>商品促销、订单促销</p>
										<p class="systemInitialization1"><span class="systemInitialization2">设置：</span>商品列表、商品分类、商品品牌、客户级别、计量单位</p>
									</el-radio>
								</el-row>
							</el-radio-group>
						</el-form-item>
					</el-col>
				</el-row>
			</el-form>
		</div>
		<div class="queren" :class="{btnBox_98:!$store.state.headFold}">
			<el-button type="primary" @click="systemInitialization">立即初始化</el-button>
		</div>
		<!--end content-->
	</section>
</template>

<script>
	export default {
		data() {
			return {
				//form的数据
				formData:{
					textRule_input:"",  //非空校验的文本框
					text_input:"",  //无校验的文本框
					mobilePhone_input:"",  //手机号校验
					number_input:"",  //数字类型校验
					textRule1_input:"",  //长度限制的文本框
					state_select:"",  //下拉选择
					area_select:[],  //区域的级联选择，这里的类型须为array
					logoImgSrc:"",  //头像上传
					certificateImgSrc:"",  //身份证上传
					password_input:"",  //password
					passwordAff_input:"",  //确认密码
					checkbox_value:[],  //chcekbox
					radio_value:"",  //radio
					compantRemark:"",  //文本域
				},
			}
		},
		methods: {
			systemInitialization() {
				this.$confirm('请确认是否立即初始化？', '确认', {
			        confirmButtonText: '确定',
			        cancelButtonText: '取消',
			        cancelButtonClass:"fr",
			        confirmButtonClass:"fr",
			        customClass:"clearfixBox"
				}).then(() => {
					this.axios({
						method: 'PATCH',
						url: "/v3/misc/common/123/systemInitialization",
						params:{
							"flag":this.formData.radio_value
						}
					}).then((res) => {
						this.Public.openSuccess(this,"操作成功！");
					}).catch((err)=>{
						this.Public.openError(this,err.response.data);
				    });
			    }).catch(()=>{
			    	//取消
			    });
			},
		},
		mounted() {
			this.$refs['form'].$el.style.height = (document.documentElement.clientHeight - 175) + 'px';
		}
	}
</script>

<style scoped>
  .queren{
    position: fixed;
    bottom: 0px;
    width: 87%;
    background: #fff;
    height: 80px;
    z-index: 10;
  }

  .queren a{
    display: inline-block;
    height: 34px;
    line-height: 34px;
    background: #fff!important;
    border: 1px solid #cdd9e6 ;
    color: #666!important;
    width: 86px;
    border-radius:20px;
    text-align: center;
    margin: 20px 20px 0px 10px;
    box-sizing: border-box;
  }
  .queren .baocun{
    color: #fff!important;
    background: #13C19F!important;
    z-index: 100;
    cursor: pointer;
    border: 0;
    margin-left: 30px;
  }

  .xtTitle{
    font-size:14px;
    margin-bottom:6px;
    display:inline-block;
    height: 24px;
    line-height: 24px;
  }
	*{transition:.2s;}
	section {display: flex;flex-direction: column;flex: 1;}
	div.location {flex: 0 0 10px; padding: 3px 0 15px 0;}
	div.wrap {position: relative;flex: 1;width: 100%;padding: 15px 20px 0 20px;box-sizing: border-box;background: #fff;}
	.scroll {overflow-y: auto;overflow-x: hidden;padding-right: 10px;}
	.title {height: 50px;color: #03B8CC;font-size: 16px;}
	.selectWidth {width: 100%;}
	.btnBox_180 {position: absolute;bottom: 10px;left:180px;height: 50px;background: #fff;z-index: 100;}
	.btnBox_98 {left:98px;}
	/* start upload */
	.avatar-uploader_95{width:95px}
	.avatar-uploader {position: relative;border: 1px dashed #d9d9d9;border-radius: 6px;cursor: pointer;overflow: hidden;z-index: 9;}
	.avatar-uploader:hover {border-color: #03B8CC;}
	.avatar-uploader-icon {font-size: 20px;color: #8c939d;width: 95px;height: 95px;line-height: 95px;text-align: center;}
	.certificate {width:372px;}
	/* end upload */
	.intensitySpan{display: inline-block;width: 120px; height: 20px;line-height: 20px;text-align: center!important;background: #e9ecf3;color: #fff;margin-right: 3px!important;font-size: 13px;}
	.systemInitialization1{
		font-size:12px;
		margin-left:20px;
		color: #8c939d;
		height: 17px;
	}
	.systemInitialization2{
		font-size:12px;
		font-weight:900;
	}
</style>
